package com.ssyx.activity.feign;

import com.ssyx.model.product.Category;
import com.ssyx.model.product.SkuInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * ClassName:ProductFeignClient
 * Description:
 *
 * @Author kay
 * @Create 2024/5/6 0:30
 * @Version 1.0
 */
@FeignClient(value = "service-product")
public interface ProductFeignClient {

    //根据skuIdList,批量获取商品信息
    @PostMapping("/api/product/inner/findSkuInfoList")
    List<SkuInfo> findSkuInfoList(@RequestBody List<Long> skuIdList);

    //根据关键字获取sku列表，活动使用
    @GetMapping("/api/product/inner/findSkuInfoByKeyword/{keyword}")
    List<SkuInfo> findSkuInfoByKeyword(@PathVariable("keyword") String keyword);

    //根据分类id的集合,获取商品分类集合信息
    @GetMapping("/api/product/inner/getCategoryList")
    List<Category> getCategoryList(@RequestBody List<Long> categoryIdList);

    //根据商品skuId,获得其分类id
    @GetMapping("/api/product/inner/getCategoryIdBySkuId/{skuId}")
    Long getCategoryIdBySkuId(@PathVariable Long skuId);
}
